<?php
session_start();
include('../config.php'); 
LinkDataBase();

$sheet = $_POST ["sheet"];

$SheetCounter = 0;

while($sheet[$SheetCounter] != NULL)
{
	$sql = "delete from sheet where table_name ='".$sheet[$SheetCounter]."' AND filename='".$_GET['filename']."'";
	$result= mysql_query($sql);
	$sql = "delete from ".$_GET['filename']." where table_name ='".$sheet[$SheetCounter]."'";
	$result= mysql_query($sql);
	$SheetCounter++;
}
header("Location:../sheetlist/index.php?filename=".$_GET['filename']."&Page=".$_GET['Page'] );
?>